#!/usr/bi/python3

import urllib.request
import lxml.etree
from lxml.cssselect import CSSSelector

url = 'http://weather.yahoo.com/united-states/illinois/chicago-2379574/'
response = urllib.request.urlopen(url)
html = response.read()

parser = lxml.etree.HTMLParser(encoding='utf-8')
doctree = lxml.etree.fromstring(html, parser)

span = CSSSelector("span.num")
temp = span(doctree)[0].text
print('The current temperature in Chicago is', temp)
